<%-- 
    Document   : swich
    Created on : Dec 25, 2011, 7:48:07 PM
    Author     : EADeveloper
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <% if (request.getParameter("hostname") != null) {
        %>
        <%=request.getParameter("hostname")%>
        <%                
                String[] host = request.getParameter("hostname").split(":");
                session.setAttribute("host", host[0]);
                session.setAttribute("port", host[1]);
                String proto = host[2];
                
                if (proto.equals("ssh")) {
                    response.sendRedirect("ssh/ssh.jsp");
                } else {
                    response.sendRedirect("telnet/telnet.jsp");
                }
            }
        %>

    </body>
</html>
